package com.study.springboot_25_mqkafka.service.impl;

import com.study.springboot_25_mqkafka.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/13 8:43 下午
 */

@Service
public class MessageServiceKafkaImpl implements MessageService {

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    @Override
    public void sendMessage(String id) {
        System.out.println("加入短信发送队列 -- KafkaMq 处理 " + id);
        kafkaTemplate.send("test", id);
    }

    @Override
    public String doSendMessage() {
        return null;
    }
}
